<?php echo $this->Html->css(array(HOST.'/dictionary',HOST.'/form',HOST.'/actions'),null,array('inline'=>false));?>
<?php echo $this->Html->script(array(HOST.'/actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>

<body>
<?php echo $this->Section->main(); ?>

	<div class="container container_3">		
		<div class='grid_1'>
			<?php echo $this->Html->link($this->Html->image(HOST.'/logo.png'),'/',array('escape'=>false))?>
			<?php echo $this->element('menu-left')?>
		</div>		
		<div class='grid_2'>
			<div class="container container_offers_3">
				<div class="offers_grid_3">
					<div class="content">





						<div class="offers form">
						<?php echo $this->Form->create('Offer');?>
							
								<h2><?php __('Edit Offer'); ?></h2>
								<table style="width: 100%; ">
									<tr>
										<td valign="top">
										<?php
										if(isset($columns) && is_array($columns)){
										foreach ($columns as $name => $row) {
											if($row['onoff'] && isset($this->data['Offer'][$name]) && !empty($this->data['Offer'][$name])){
												?>
										<div class="category_grid_2">
											<div class="content">								
											<?php echo $this->Form->input($name,array('label'=>$row['name'])); ?>
											</div>
										</div>	
										<?php }}}?>		
										<div class='clear'>&nbsp;</div>
										
											<?php
												echo $this->Form->input('id');
												echo $this->Form->input('promocja',array('options'=>array(1=>__('Oferty promocyjne',true),2=>__('Baner główny',true)),'empty'=>''));
												/*echo $this->Form->input('idoferta');
												echo $this->Form->input('idklient');
												echo $this->Form->input('typ_id');
												echo $this->Form->input('transakcja_id');
												echo $this->Form->input('region');
												echo $this->Form->input('miasto');
												echo $this->Form->input('dzielnica');
												echo $this->Form->input('ulica');
												echo $this->Form->input('kraj');
												echo $this->Form->input('lokalizacja');
												echo $this->Form->input('powierzchnia_od');
												echo $this->Form->input('powierzchnia_do');
												echo $this->Form->input('cena_od');
												echo $this->Form->input('cena_do');
												echo $this->Form->input('waluta');
												
												echo $this->Form->input('synchinfo');
												echo $this->Form->input('powiat');
												echo $this->Form->input('promoted');
												echo $this->Form->input('numer');
												echo $this->Form->input('kodp');
												*/
											?>
										</td>
										<td valign="top">
											<?php
												/*echo $this->Form->input('aprowadzacy');
												echo $this->Form->input('wprowadzono');
												echo $this->Form->input('zmiany');
												
												echo $this->Form->input('pokoje');
												echo $this->Form->input('pietro');
												echo $this->Form->input('l_pieter');
												echo $this->Form->input('l_pokoi');
												echo $this->Form->input('forma_wlasnosci');
												echo $this->Form->input('rynek');
												echo $this->Form->input('czynsz');
												echo $this->Form->input('typ_zabudowy');
												echo $this->Form->input('pow_dzialki');
												echo $this->Form->input('wolne_od');
												echo $this->Form->input('l_lazienek');
												echo $this->Form->input('dojazd');
												echo $this->Form->input('stan_mieszkania');
												echo $this->Form->input('rok_budowy');
												echo $this->Form->input('pow_piwnicy');
												echo $this->Form->input('kuchnia');
												echo $this->Form->input('balkon');
												echo $this->Form->input('Image');*/
											?>
										</td>
									</tr>
									<tr>
										<td>
											<?php 
											/*echo $this->Form->input('html');*/
											echo $this->Form->input('opis_publiczny',array('style'=>'width: 100%; padding: 3px 0px 3px 0px; margin: 3px 0px;'));
											?>
										</td>
									</tr>
								</table>
						<?php echo $this->Form->end(__('Submit', true));?>
						</div>
						<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>		
						<div class="actions main_actions">

							<h3><?php __('Actions'); ?></h3>
							<ul>
						
								<li><?php echo $this->Html->link(__('Usuń ofertę', true), array('action' => 'delete', $this->Form->value('Offer.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $this->Form->value('Offer.id'))); ?></li>
								<li><?php echo $this->Html->link(__('Lista ofert', true), array('action' => 'index'));?></li>
								<li><?php echo $this->Html->link(__('Słownik typów', true), array('controller' => 'typs', 'action' => 'index')); ?> </li>
								<li><?php echo $this->Html->link(__('Opcje wyswietlanai', true), array('controller' => 'offers_columns','action' => 'index'));?></li>
								<li><?php echo $this->Html->link(__('Słownik transakcji', true), array('controller' => 'transakcjas', 'action' => 'index')); ?> </li>
								<li><?php //echo $this->Html->link(__('Dodaj zdjęcie', true), array('controller' => 'images', 'action' => 'add')); ?> </li>
								
							</ul>
						</div>
						<?php }?>						
						
						
						
					</div>
				</div>
			</div>
		</div>
		<div class='clear'>&nbsp;</div>
		<?php echo $this->element('footer')?>
	</div>
	<div class='clear'>&nbsp;</div>
</body>						